package com.horay.springclouddemo.consumer.hystrix.client.fallback;

import com.horay.springclouddemo.common.http.Responses;
import com.horay.springclouddemo.common.http.ResultBody;
import com.horay.springclouddemo.consumer.hystrix.client.HystrixFeignClient;
import com.horay.springclouddemo.model.hystrix.Hystrix;
import com.horay.springclouddemo.model.hystrix.HystrixDTO;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;

/**
 * 豪猪备用客户端实现
 *
 * @author heyingcheng
 * @date 2020/3/21 22:59
 */
@Component("HystrixFallbackClient")
public class HystrixFallbackClient implements HystrixFeignClient {

    /**
     * 新增豪猪
     *
     * @param hystrix
     * @return org.springframework.http.ResponseEntity
     * @author heyingcheng
     * @date 2020/3/21 14:17
     */
    @Override
    public ResponseEntity<ResultBody> createHystrix(Hystrix hystrix) {
        return Responses.unprocessableEntityMessage(HystrixFallbackClient.class.getName());
    }

    /**
     * 获取豪猪
     *
     * @param id
     * @return org.springframework.http.ResponseEntity
     * @author heyingcheng
     * @date 2020/3/21 14:17
     */
    @Override
    public ResponseEntity<ResultBody> getHystrix(Integer id) {
        return Responses.unprocessableEntityMessage(HystrixFallbackClient.class.getName());
    }

    /**
     * 获取豪猪集合
     *
     * @param hystrixDTO
     * @return org.springframework.http.ResponseEntity
     * @author heyingcheng
     * @date 2020/3/21 14:18
     */
    @Override
    public ResponseEntity<ResultBody> getHystrixs(HystrixDTO hystrixDTO) {
        return Responses.unprocessableEntityMessage(HystrixFallbackClient.class.getName());
    }

    /**
     * 更新豪猪
     *
     * @param hystrix
     * @return org.springframework.http.ResponseEntity
     * @author heyingcheng
     * @date 2020/3/21 14:18
     */
    @Override
    public ResponseEntity<ResultBody> updateHystrix(Hystrix hystrix) {
        return Responses.unprocessableEntityMessage(HystrixFallbackClient.class.getName());
    }

    /**
     * 删除豪猪
     *
     * @param id
     * @return org.springframework.http.ResponseEntity
     * @author heyingcheng
     * @date 2020/3/21 14:19
     */
    @Override
    public ResponseEntity<ResultBody> deleteHystrix(Integer id) {
        return Responses.unprocessableEntityMessage(HystrixFallbackClient.class.getName());
    }

}
